home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / Source / PlainText / PlainText Worksheet < prev    next >
Text File  |  1994-02-03  |  15KB  |  306 lines

  1. ;----------------------------------------------------------------------------
  2. ;                                 Worksheet
  3. ;
  4. ; Use this window as a scratch pad for keeping notes and as a space for 
  5. ; temporary and intermediate work. Its contents are saved between launches
  6. ; of the PlainText program. If you don't like the idea of having a work-
  7. ; that is always open, select the "No Worksheet" option in the Edit Menu.
  8. ;
  9. ;                                            Mel Park, Memphis, Tennessee
  10. ;----------------------------------------------------------------------------
  11.  
  12.     This is the first non-beta version of PlainText. All major features 
  13. work, and seem to work well, on the machines I and others have tested 
  14. them on. 
  15.  
  16.     You should make a copy of this file and save it somewhere with a
  17. different name. One way of doing this is to select the “Save a Copy”
  18. item from the File Menu. Name the copy “Original PlainText Worksheet” or
  19. some such.
  20.  
  21. File Menu
  22.     This is standard Mac stuff. PlainText will open any text file. Printing
  23. is pretty ordinary. There is no way to change print margins or lines per 
  24. page. PlainText does print the page number at the bottom of each page. If 
  25. you hold the option key down while selecting the Open menu item, then all 
  26. files, not just text files, are displayed and can be opened. Files opened 
  27. in this way are read only. You can copy data from them to the clipboard but 
  28. not change them in any way.
  29.  
  30.     The “Save” menu item is only activated when a file has been changed
  31. by adding or removing characters. The term “dirty” is commonly used to 
  32. describe text files in this state. Non-editing changes, such as changing 
  33. the font or adding a mark do not dirty a file. However, all such changes,
  34. even scroll position and selection range, are always saved to disk when 
  35. you close a file. So, don’t be surprised  by disk activity when you close 
  36. a file in which you made no changes.
  37.  
  38. Edit Menu
  39.     Shift Right and Shift Left add or remove one tab on each line or,
  40. when word wrap is in, each paragraph within the selection region. At the 
  41. same time, it converts all space runs to the corresponding number of tabs. 
  42. “Align” aligns all subsequent lines to the first line in the selection 
  43. region. 
  44.  
  45.     Check out the Undo function. It really works like it should. “No
  46. Worksheet” will close the worksheet window and set PlainText to not open a
  47. worksheet window in the future. It is reversed by the “Use Worksheet” menu
  48. item which becomes an option when there is no worksheet. The Format dialog
  49. of the Edit Menu is where you select fonts and font size, turn word-
  50. wrapping on or off (on is the default), select tab width, and show or not
  51. show invisible characters. These settings are remembered for each document
  52. and retained between launches. (Naturally, this is a Mac.)
  53.  
  54.     The “Show Invisibles” check box prints ‘¿’ for all non-printing 
  55. characters, ‘Δ’ for tabs, ‘¬’ for carriage returns, and ‘◊’ for spaces.
  56.  
  57. Find Menu
  58.     This all works. “Find…” and “Replace…” are pretty standard and pretty
  59. intuitive functions for text windows. The search string can be a selection
  60. expression, that is, an expression that contains wildcards. Try a search
  61. using *menu as the selection expression. Choose “Find…” and type “*menu”
  62. (with or without quotes) and click the “Selection Expression” radio button. 
  63. Now click the Find button (or hit the return key). See how a line containing 
  64. “menu” has been found? Command-G repeats the search.
  65.  
  66.     If the selection expression is a number, it is interpreted as a line 
  67. number. Try 67 as a selection expression.
  68.  
  69.     This line, the 67th in this window, will be selected.
  70.  
  71.     If you hold down the shift key when you choose any of the Find menu 
  72. items, then the search will be in the reverse direction. This is handiest 
  73. when used in conjunction with the keyboard equivalents command-h and 
  74. command-g. 
  75.  
  76. Mark Menu
  77.     Marks are like bookmarks that you can place in a text file so that you
  78. can recall previous selections. When you select a mark from the Mark Menu,
  79. the text corresponding to that mark is selected and the window scrolls to
  80. show it. You can add new marks with the Mark menu item and remove them with
  81. Unmark. You can alphabetize the order in which marks are displayed in the
  82. Mark Menu by selecting the Alphabetize menu item. Selecting it again
  83. restores the original order. Look at the Marks that I have made for this
  84. file by opening the Marks Menu.
  85.  
  86. Window Menu
  87.     Stack and Tile windows work, as does the rest, a catalog of open
  88. windows. The menu item for the front window is checked. The target window
  89. is indicated by the bullet symbol (•). Windows whose changes have not
  90. yet been saved to disk are underlined.
  91.  
  92. Convert Menu
  93.     These functions all work. If you spot bugs in them, be sure to let
  94. me know. This set of functions, by the way, was selected from those I
  95. find myself using many times a day in Vantage, the desk accessory editor
  96. I have used for years. The big, full-featured editors, like Pete Keleher’s
  97. Alpha and BBEdit, by Rich Siegel, have these features, plus many more, as
  98. well. Strip Linefeeds is the way to convert an MS/DOS text file to the
  99. Mac convention. Form Paragraphs and Straight to Curly Quotes gets it ready
  100. for pasting into a word processor. Hard Wrap to Window and Curly to Straight
  101. quotes reverses those steps, as when you want to prepare text for e-mail.
  102. Both Hard Wrap functions insert hard carriage returns at line ends, where
  103. a line end is either defined by the size of the window (Hard Wrap to Window)
  104. of the line length parameter set in the Format Dialog (Hard Wrap to Length).
  105.  
  106.     Besides being fast and able to handle even very large files, PlainText
  107. has these built-in features:
  108.  
  109.     1.    Double-clicking selects a whole word. Note that double-clicking
  110.         the space after a word selects the preceeding word and the space.
  111.         This is a bug that is close enough to being a feature that I am 
  112.         not fixing it.
  113.     2.    Triple-clicking selects a whole line.
  114.     3.    Double clicking on or just before a bracket or parenthesis (i.e. 
  115.         “[”, “{”, etc.) causes all the text between the bracket or 
  116.         parenthesis and its matching bracket or parenthesis to become 
  117.         selected.
  118.     4.    Cutting, pasting, and undoing are fully implemented.
  119.     5.    The arrow keys work to move the insertion point or selection (hold
  120.         the shift key down) in the expected ways.
  121.     6.    Command-option-uparrow moves the insertion point to the top of the
  122.         file. Command-option-downarrow does the opposite. Holding the shift
  123.         key down while doing either of these extends the selection to either
  124.         the top or bottom of the document.
  125.     7.    Command-right arrow moves the insertion point to the end of the 
  126.         current line. Option-right arrow moves the cursor by words. The left
  127.         arrow combinations work in the same way, of course, and holding the
  128.         shift key down with any of these combinations extends the selection.
  129.         This is the standard Macintosh use of the arrow keys.
  130.     8.    It is a command-line interpreter in its own right. Simply type a 
  131.         command that PlainText understands and then hit the enter (not
  132.         return) key. This will work in any text window.
  133.  
  134.         The following commands can be executed from any text window: 
  135.         ls (same as dir in DOS), cd (change directory), open, target,
  136.         find, line. Open opens the named file and makes it the front window.
  137.         File is similar except the window is made the target window (second
  138.         from front). “line n” selects selects the nth line of the target
  139.         window (n is a number. “Find exp” searchs the target window for the
  140.         string “exp.” Wildcards can be used with the find and ls commands,
  141.         just as you would expect in DOS.
  142.  
  143.         In summary, hitting the enter key causes the current line or current 
  144.         selection, whichever is smaller, to be interpreted as a command line.
  145.  
  146.         Commands implemented:
  147.  
  148.             cd            Change default directory (folder). Note, the Mac 
  149.                         file system uses the colon to designate the present 
  150.                         or higher folders. Thus “cd ::” changes the default
  151.                         directory one level up. 
  152.             file        Open a file and make it the target
  153.             find ss        Find a string in the target window
  154.             ls            List a directory’s contents
  155.             ls -l        Give a full listing of a directory’s contents
  156.             line nn        Select line nn in the target window
  157.             open ff        Open a file
  158.  
  159. Target Window
  160.     Note that the “line” and “find” comands operate on the TARGET window. 
  161. The target window is the window behind the front-most window.
  162.  
  163. Large Files
  164.     PlainText must load it’s text files entirely into memory. If you get
  165. an out-of-memory error message when trying to open a very large file, just
  166. increase the partition (in the Finder’s Get-Info box for PlainText) to be 
  167. larger than the file being opened. In System 7, turn on virtual memory
  168. if necessary.
  169.  
  170. Bug Reports
  171.  
  172.     Send comments and complaints to:
  173.  
  174.         Mel Park
  175.         Associate Professor
  176.         Department of Anatomy and Neurobiology
  177.         University of Tennessee
  178.         855 Monroe Avenue
  179.         Memphis, TN 38163
  180.         (901) 448-5984
  181.         mpark@utmem1.utmem.edu
  182.  
  183. PlainText is free.
  184.  
  185. Revision History
  186.  
  187. 0.4:     Fixed Standard File System 6 incompatibilities.
  188. 0.5:     Wordwrap is now the default.
  189.          Horizontal scroll bar occurs when it should.
  190.          Wordwrap to window correctly updates window.
  191.          Fixed Out of Memory problem with add linefeeds.
  192. 0.6:     Worksheet is an option.
  193.          Added font scaling and changing.
  194.          Open, file, and line commands now work in System 6.
  195.          All text moved to resources so that PlainText can now be
  196.            internationalized.
  197. 0.7:     Added Aligh, Shift Left, and Shift Right functions.
  198.          Fixed bug in which a strings just past the cursor were not
  199.            found in a forward search.
  200.          Open with option key down shows all files, not just text
  201.            files.
  202. 0.8:     SaveAFile stores resources properly and no longer causes
  203.            crashes.
  204.          The Standard File dialog is no longer displayed twice for new 
  205.            files.
  206.          Typing no longer overwrites the horizontal scroll bar.
  207.          Fixed some minor annoyances in v. 0.8a, like new windows coming
  208.            up with the wrong horizonal scroll bar and the cursor not being
  209.            erased when a window is deselected.
  210. 0.9:     There were bad crashes after some combinations of “Returns to
  211.            Linefeeds” and Saves or Closes, due to an old bug in the Mac
  212.            Menu Manager. Fixed now.
  213.          Similar bug was causing the Edit Menu to disappear when “No 
  214.            Worksheet” was selected.
  215.          Worksheet and non-worksheet windows open with or without a 
  216.            Go-Away Box as they should.
  217.          Added partial support for extended keyboard (Undo, cut, paste,
  218.            copy, page up, page down).
  219.          In System 7, opening from the finder directs Standard File package
  220.            to proper directory.
  221.          Horizonal arrow keys work properly except anchor point not yet
  222.            implemented.
  223. 0.91:     Extended keyboard fully implemented.
  224.          Fixed crashes due to Menu Manager bug.
  225. 1.0:     Added entab and detab functions.
  226.          Added word wrap to line lengths
  227.          Added autoindent
  228.          These last required additions to Format dialog.
  229.          Horizontal arrow keys now have an anchor point.
  230.          Word wrap to window is default for foreign text files as well
  231.            as new ones.
  232.          Command-arrow key functions now update the scroll bars.
  233.          Fixed conditions that would could cause a window to forget 
  234.            that it was dirty, with subsequent loss of most-recently 
  235.            typed data.
  236.          Text inserted at end of a line now drawn properly.
  237.          Errors in calculating buffer length in this last condition
  238.            also fixed.
  239.          Blinking cursor no longer interferes with text.
  240.          Show Invisibles with proportional fonts now works properly.
  241.          Go-Away box appears when it should in all conditions. 
  242.          Fixed System 6 bugs--can now open from finder.
  243.          Hiliting of selection range is now always in the right place.
  244.          Inserting text beginning with a carriage return used to foul up
  245.            the line starts array. This could cause a crash.
  246.          Crashes related to marks and selections beyond the text buffer
  247.            fixed.
  248. 1.1:     Fixed crashes due to errors in writing resources.
  249.          This means that resource forks are no longer corrupted.
  250.          Word wrap to length now works for newly opened documents.
  251.          Marks stopped working in v.1.0. Fixed.
  252.          Text now updated after Tile or Stack Windows.
  253.           Scroll bars now properly hilited after Tile and Stack Windows.
  254. 1.2:     Format and date in ls -l command now correct.
  255.          Searches for Entire Word now work.
  256.          All Clipboard window deficiencies fixed, i.e. it is now updated
  257.            as it should be after cuts and copies, Menus are properly
  258.            updated when this is the selected window, and the blinking
  259.            cursor is disabled.
  260.          In large files, the blinking cursor would be displayed as a long
  261.            vertical line when the window was scrolled more than 32K pixels
  262.            beyond the insertion point. Fixed.
  263.          Line length default really set to 75. This means that the “Word 
  264.            Wrap to Length” menu item works from the very beginning.
  265.          Implemented “Revert to Saved.”
  266.          Fixed scrolling error when large blocks of text deleted.
  267. 1.2a:     When word wrap is on, Autoindent indents paragraphs, not lines.
  268.          PlainText will now open documents on locked volumes.
  269.          Saving now always flushes files to disk with every Save, even if 
  270.            it is a sleeping PowerBook disk.
  271.          Tile and Stack Windows now work properly when there is no 
  272.            worksheet.
  273.          No longer asks to save a saved new document when quitting.
  274.          Short lines nolonger pirate* the up and down arrow key cursor
  275.            movements.
  276.          Shift and align improved to work on word-wrapped paragraphs.
  277. 1.2b:     Marks now aligned after pasting text.
  278.          Will now print beyond 32K of text.
  279. 1.2c:     Marks now updated after large selections of text deleted.
  280.          Will now print invisible characters and tabs.
  281. 1.2d:     Added page numbers to printed page.
  282. 1.2.1:     First non-beta release to public servers, i.e. Info-Mac.
  283.           Restored “File open in another application” alert.
  284.           In word wrap, adding or deleting text that caused rewrapping of
  285.             paragraphs with more than 32 lines used to blank part of the 
  286.             window above the changed text. Fixed.
  287.          
  288. Known bugs
  289.      Marks are not properly updated after entab and detab functions.
  290.      Marks sometimes not updated properly during normal editing. (Probably 
  291.        fixed in v.1.2b.)
  292.  
  293. Features to be added:
  294.      Searching for carriage returns and other special characters.
  295.      More flexible saving of preferences.
  296.      Compile in PowerPC native mode.
  297.  
  298. Thanks to Florin Neumann, Robert J. Rockefeller, Bruce Craven, Ralph 
  299. Muha, Michael O’Henly, Ted Ripberger, Rich Siegel, Scott Gruby, and
  300. particularly to Rich Scarlet for their many helpful comments.
  301.  
  302. ------------
  303.  
  304. * Geo-speak. A stream is pirated when its flow is diverted into a 
  305.   neighboring water course.
  306.